﻿@inherits AdminCompontentBase

@if (StyleType == StyleTypes.Toggle)
{
    <MButtonGroup Class="@Class" Style="@Style" Value="Value.ToString()" Rounded>
        @foreach (var (key, value) in KeyValues)
        {
            <MButton Disabled="Disabled" OnClick="async() => await ValueChanged.InvokeAsync(value)" Value="@value.ToString()" Class="@(Value.Equals(value) ? "button-group-active":"button-group")">
                <SIcon Size=18>fa fa-regular fa-mars</SIcon>
                <span class="ml-1">@T(key)</span>
            </MButton>
        }
    </MButtonGroup>
}
else
{
    <MButtonGroup Value="Value.ToString()" Class="@($"rounded-lg elevation-tab {Class}")" Style="@Style" Dense Mandatory Borderless>
        @foreach (var (key, value) in KeyValues)
        {
            <MButton Disabled="Disabled" OnClick="async() => await ValueChanged.InvokeAsync(value)" Value="@value.ToString()" Ripple=false Class="rounded-lg px-5 py-1" Style="flex:1">
                @T(key)
            </MButton>
        }
    </MButtonGroup>
}
